package com.atguigu.r2dbc.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;

import java.time.Instant;

/**
 * @author lfy
 * @Description
 * @create 2023-12-24 20:17
 */
@Table("t_book")
public class TBookAuthor {
    @Id
    private Long id;
    private String title;
    private Long authorId;
    private Instant publishTime; //响应式中日期的映射用 Instant 或者 LocalXxx
    private TAuthor author; //每本书有唯一作者；

    public TBookAuthor() {
    }

    public TBookAuthor(Long id, String title, Long authorId, Instant publishTime, TAuthor author) {
        this.id = id;
        this.title = title;
        this.authorId = authorId;
        this.publishTime = publishTime;
        this.author = author;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Long getAuthorId() {
        return authorId;
    }

    public void setAuthorId(Long authorId) {
        this.authorId = authorId;
    }

    public Instant getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Instant publishTime) {
        this.publishTime = publishTime;
    }

    public TAuthor getAuthor() {
        return author;
    }

    public void setAuthor(TAuthor author) {
        this.author = author;
    }
}
